package cn.cloud.butler.webapi.service;

import cn.cloud.butler.webapi.domain.ScrewTimeEntity;
import cn.cloud.butler.webapi.repository.ScrewTimeRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MachineScrewService {
    private  final ScrewTimeRepository screwTimeRepository;

    @Autowired
    public MachineScrewService(ScrewTimeRepository screwTimeRepository) {
        this.screwTimeRepository = screwTimeRepository;
    }

    @Cacheable(value = "SelScrewTime-macsn")
    public List<ScrewTimeEntity> SelScrewTime(String macsn) {
        return  screwTimeRepository.findByMacsn(macsn);

    }
}
